package com.zxt.dental_sys.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName chat_online_info
 */
@TableName(value ="chat_online_info")
@Data
public class ChatOnlineInfo implements Serializable {
    /**
     * 用户聊天
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 发送方id
     */
    private String sendUserFk;

    /**
     * 接收方id
     */
    private String receptUserFk;

    /**
     * 聊天内容
     */
    private String contentInfo;

    /**
     * 内容类型,1文本，2图片
     */
    private Integer contentType;

    /**
     * 发送时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date inputTime;

    /**
     * 是否删除[0正常，1删除]
     */
    private Integer isDeleted;

    /**
     * 是否撤回[0正常，1撤回]
     */
    private Integer isBack;

    /**
     * 公司pk
     */
    private Long companyFk;

    /**
     * 岗位pk
     */
    private Long jobFk;

    /**
     * 是否已读[0没有，1已读]
     */
    private Integer isReaded;

    /**
     * 发送方是否删除[0正常，1删除]
     */
    private Integer sendDeleted;

    /**
     * 接收方是否删除[0正常，1删除]
     */
    private Integer receptDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ChatOnlineInfo other = (ChatOnlineInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSendUserFk() == null ? other.getSendUserFk() == null : this.getSendUserFk().equals(other.getSendUserFk()))
            && (this.getReceptUserFk() == null ? other.getReceptUserFk() == null : this.getReceptUserFk().equals(other.getReceptUserFk()))
            && (this.getContentInfo() == null ? other.getContentInfo() == null : this.getContentInfo().equals(other.getContentInfo()))
            && (this.getContentType() == null ? other.getContentType() == null : this.getContentType().equals(other.getContentType()))
            && (this.getInputTime() == null ? other.getInputTime() == null : this.getInputTime().equals(other.getInputTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
            && (this.getIsBack() == null ? other.getIsBack() == null : this.getIsBack().equals(other.getIsBack()))
            && (this.getCompanyFk() == null ? other.getCompanyFk() == null : this.getCompanyFk().equals(other.getCompanyFk()))
            && (this.getJobFk() == null ? other.getJobFk() == null : this.getJobFk().equals(other.getJobFk()))
            && (this.getIsReaded() == null ? other.getIsReaded() == null : this.getIsReaded().equals(other.getIsReaded()))
            && (this.getSendDeleted() == null ? other.getSendDeleted() == null : this.getSendDeleted().equals(other.getSendDeleted()))
            && (this.getReceptDeleted() == null ? other.getReceptDeleted() == null : this.getReceptDeleted().equals(other.getReceptDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSendUserFk() == null) ? 0 : getSendUserFk().hashCode());
        result = prime * result + ((getReceptUserFk() == null) ? 0 : getReceptUserFk().hashCode());
        result = prime * result + ((getContentInfo() == null) ? 0 : getContentInfo().hashCode());
        result = prime * result + ((getContentType() == null) ? 0 : getContentType().hashCode());
        result = prime * result + ((getInputTime() == null) ? 0 : getInputTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getIsBack() == null) ? 0 : getIsBack().hashCode());
        result = prime * result + ((getCompanyFk() == null) ? 0 : getCompanyFk().hashCode());
        result = prime * result + ((getJobFk() == null) ? 0 : getJobFk().hashCode());
        result = prime * result + ((getIsReaded() == null) ? 0 : getIsReaded().hashCode());
        result = prime * result + ((getSendDeleted() == null) ? 0 : getSendDeleted().hashCode());
        result = prime * result + ((getReceptDeleted() == null) ? 0 : getReceptDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", sendUserFk=").append(sendUserFk);
        sb.append(", receptUserFk=").append(receptUserFk);
        sb.append(", contentInfo=").append(contentInfo);
        sb.append(", contentType=").append(contentType);
        sb.append(", inputTime=").append(inputTime);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", isBack=").append(isBack);
        sb.append(", companyFk=").append(companyFk);
        sb.append(", jobFk=").append(jobFk);
        sb.append(", isReaded=").append(isReaded);
        sb.append(", sendDeleted=").append(sendDeleted);
        sb.append(", receptDeleted=").append(receptDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}